package beans;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;

import modelo.Persona;

@ManagedBean
@RequestScoped
public class PersonaBean {

	private String user;
	private String pass;
	private Persona persona = new Persona();

	public Persona getPersona() {
		return persona;
	}

	public void setPersona(Persona persona) {
		this.persona = persona;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public String getPass() {
		return pass;
	}

	public void setPass(String pass) {
		this.pass = pass;
	}

	public boolean verificarSesion() {
		boolean estado;
		if (FacesContext.getCurrentInstance().getExternalContext()
				.getSessionMap().get("persona") == null) {
			estado = false;
		} else {
			estado = true;
		}
		return estado;
	}

}
